package basics;

/**
 * 测试类的初始化顺序
 *
 * @Author: zhenzhong.wang
 * @Time: 2018/4/24 10:25
 */
public class Demo3 extends Ex {

  static {
    System.out.println(1);
  }

  static Ex e1 = new Ex(2);
  Ex2 e2 = new Ex2();

  static {
    Ex e3 = new Ex(4);
  }

  static Ex e5 = new Ex(5);

  public Demo3() {
    System.out.println(6);
  }

  public static void main(String[] args) {
    new Demo3();
  }

}

class Ex {

  static {
    System.out.println("test");
  }

//  Ex3 e = new Ex3();

  public Ex(Integer i) {
    System.out.println(i);
  }

  public Ex() {
    System.out.println("Ex public");
  }
}

class Ex2 {
  public Ex2() {
    System.out.println("Ex2 public");
  }
}





class Ex3 {
  public Ex3() {
    System.out.println("Ex3 public");
  }
}
